# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=mycroft-gui
pkgver=1.0.1
pkgrel=1
pkgdesc="The Graphical User Interface used by the Mycroft Mark II and more"
url="https://mycroft.ai"
# armhf blocked by extra-cmake-modules
# ppc64le, s390x and riscv64 blocked by qt5-qtwebengine -> qt5-qtwebview
arch="all !armhf !ppc64le !s390x !riscv64"
license="Apache-2.0"
depends="kirigami2"
makedepends="
	extra-cmake-modules
	kdbusaddons-dev
	kio-dev
	plasma-framework-dev
	qt5-qtbase-dev
	qt5-qtdeclarative-dev
	qt5-qtwebsockets-dev
	qt5-qtwebview-dev
	"
checkdepends="xvfb-run"
source="https://github.com/MycroftAI/mycroft-gui/archive/v$pkgver/mycroft-gui-v$pkgver.tar.gz
	0001-start-stop-commands-from-environment.patch
	0002-fix-mycroft-gui-core-loader-and-stop.patch
	"

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_REMOTE_TTS=OFF
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE xvfb-run ctest
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="3177f0defd653771874b4f94a05abd1047e056a3f70a24a0e47aaa4f4155f88d3a0088715a731c20adf05db5bdcc630e2965388880d72c61d617ff3c1fde1448  mycroft-gui-v1.0.1.tar.gz
44131e11fa059e16272877ba53725ed3514a86252dbd453537703a4dbe55db233ac06ebc16692f3fd4f5d82fbcb51af0d19153445fb3f2ce6c50af3a55a1c1de  0001-start-stop-commands-from-environment.patch
1010f7a4701c845d05f476669e4956293d1bb6396102c81f14e3bb15ec5845061b5196ab4d18f765b337323d01ee53d993b504710e89a2cabba99c8689d64a9e  0002-fix-mycroft-gui-core-loader-and-stop.patch"
